package com.gosdk.p;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.SystemClock;

public class AlertManager {

	public static AlarmManager getAlarmManager(Context ctx) {
		return (AlarmManager) ctx.getSystemService(Context.ALARM_SERVICE);
	}

	public static void sendAdBroadcast(Context ctx) {
		Intent intent = new Intent(ctx, AlertReceiver.class);
		PendingIntent pendingIntent = PendingIntent.getBroadcast(ctx, 0,
				intent, 0);

		AlarmManager am = (AlarmManager) ctx
				.getSystemService(Context.ALARM_SERVICE);

		am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 30000,
				pendingIntent);
	}
}
